#ifndef IPLAYBACKACTION_H
#define IPLAYBACKACTION_H

#include "json.hpp"
#include <stdint.h>
#include <string>
#include <variant>

enum class RecoderType : uint8_t
{
    CAN,
    SLEEP,
};

struct CanRecoderData
{
    RecoderType type_;
    std::string canName_;
    int         canValue_;
};

struct SleepRecoderData
{
    RecoderType type_;
    uint32_t    count_;
};

using PlaybackData = std::variant<CanRecoderData, SleepRecoderData>;

class IplaybackAction
{
public:
    IplaybackAction() = default;
    IplaybackAction(const RecoderType& type, const std::string& sigName, const int& canValue);
    IplaybackAction(const RecoderType& type, const uint32_t& count);
    virtual void run() = 0;
    virtual void serializeJson(nlohmann::json& out) = 0;
protected:
    PlaybackData itsData;
};


#endif
